package org.nuist.service.snapshot;

import org.nuist.pojo.Snapshot;
import org.nuist.repository.SnapshotRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SnapshotServiceImpl implements SnapshotService{

    @Autowired
    SnapshotRepository snapshotRepository;

    @Override
    public void save(Snapshot snapshot) {
        snapshotRepository.save(snapshot);
    }

    @Override
    public void delete(Snapshot snapshot) {
        snapshotRepository.delete(snapshot);
    }

    @Override
    public List<Snapshot> findAll() {
        return snapshotRepository.findAll();
    }

    @Override
    public Snapshot findSnapshotByName(String name) {
        return snapshotRepository.findSnapshotByName(name);
    }

    @Override
    public Snapshot findSnapshotById(Integer id) {
        return snapshotRepository.findSnapshotById(id);
    }
}
